<!-----------在safari中打开页面------------->
<template>
  <div>
    <topheader :toptitle="toptitle"/>
    <div class="wrapper">
      <div class="wrapper-inner">
        <div class="save-safari-content">
          <p class="copy-text"><span class="copylink">复制链接在</span><i class="icon icon-safari"></i><span class="">Safari中打开</span>
          </p>
          <p class="link" v-text="message"
             v-clipboard:copy="message"
             v-clipboard:success="onCopy"
             v-clipboard:error="onError"></p>
          <i class="icon arrow-up"></i>
          <img class="game-logo" :src="gameIcon"/>
          <p class="username tc">{{gameName}}</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  import topheader from '@/components/topheader'
  import {Toast} from 'mint-ui'


  export default {
    name: 'save',
    components: {
      'topheader': topheader
    },
    data() {
      return {
        toptitle: "保存",
        message: commen.gameUrl,
        gameName: commen.gameName,
        gameIcon: commen.gameIcon
      }
    },
    created() {
    },
    methods: {
      onCopy: function (e) {
        let instance = Toast({
          message: '复制成功',
          position: 'middle',
          duration: 5000,
          iconClass: 'icon icon-success', //icon 图标的类名
          className: 'addClass'   //Toast 的类名。可以为其添加样式
        });
        setTimeout(() => {
          instance.close()
        }, 2000)
      },
      onError: function (e) {
        let instance = Toast({
          message: '该浏览器不支持自动复制',
          position: 'middle',
          duration: 5000
        });
        setTimeout(() => {
          instance.close()
        }, 2000)
      }
    }
  }
</script>
